package com.qiangesoft.blog.core.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.qiangesoft.blog.core.entity.BlogCategory;
import com.qiangesoft.blog.core.pojo.vo.CategoryCountVO;
import com.qiangesoft.blog.core.pojo.vo.BlogCategorySimpleVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 博客分类 Mapper 接口
 * </p>
 *
 * @author qiange
 * @since 2023-06-05
 */
public interface BlogCategoryMapper extends BaseMapper<BlogCategory> {

    /**
     * 分页获取分类
     *
     * @param objectPage 分页对象
     * @param name       分类名
     * @return
     */
    Page<BlogCategory> selectCategory(@Param("page") Page<BlogCategory> objectPage, @Param("name") String name);

    /**
     * 统计分类
     *
     * @return
     */
    List<CategoryCountVO> countArticle();

    /**
     * 首页获取所有分类
     *
     * @return
     */
    List<BlogCategorySimpleVO> selectAll();
}
